package work8;

import java.util.Scanner;

public class t4 {
    public static void main(String[] args) {

        System.out.println("输入字符串");
        Scanner reader = new Scanner(System.in);
        String str = reader.nextLine();

        Scanner sc = new Scanner(str);
        double sum = 0;
        sc.useDelimiter("[^1234567890.]+");
        while (sc.hasNextDouble()){
            double v =sc.nextDouble();
            System.out.println(v);
            sum += v;
        }
        System.out.println("字符串中所有数字和为："+sum);
        System.out.println("\n0501刘冰");
    }
}
